<!DOCTYPE html>
<html ng-app="myApp">
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/angular.min.js"></script>
	</head>
	<body ng-controller="myController">
		<script type="text/javascript">
			var app=angular.module("myApp",[]);
			app.factory("myFactory",function(){
				return function(val){
					return val+"-factory";
				}
			});
			app.controller("myController",["$scope","myFactory",function($scope,myFactory){
					$scope.name="依赖注入";
					console.log(myFactory($scope.name));
				};
			}])
		</script>
	</body>
</html>